function [outputArg1] = mkfigcoef(xdates,estbeta,stderrs,textsize,altbeta); 
%UNTITLED Summary of this function goes here
%   Detailed explanation goes here
outputArg1 = figure;

cigrey = [0.85 0.85 0.85];


yearticks = [2000 2010 2020];
%figure(1)
subplot(2,3,1)
zx = 2;

if nargin == 5;
     plot(xdates,altbeta(:,zx),'b-','linewidth',2)
    hold on
end;

plot(xdates,estbeta(:,zx),'g-','linewidth',2.75,'color',[7,60,101]/255);
  
lwbnd = [xdates estbeta(:,zx)-2*stderrs(:,zx)  ];
upbnd = [xdates estbeta(:,zx)+2*stderrs(:,zx)];
cipatch = [lwbnd;upbnd(end:-1:1,:)];



patch(cipatch(:,1),cipatch(:,2),cigrey)
hold on
plot(xdates,estbeta(:,zx),'g-','linewidth',2.75,'color',[7,60,101]/255)
oneline = ones(length(xdates),1);
plot(xdates,oneline(:),'--','color',[.5,.5,.5])
if nargin == 5;
     plot(xdates,altbeta(:,zx),'b-','linewidth',2)
end;

axis tight;
vaxis =   axis;
axis([xdates(1)  xdates(end)+365 vaxis(3:4)])  

set(gca,'xtick',datenum(yearticks,6,30), 'Layer', 'top')
datetick('x','keeplimits','keepticks')

if zx > 0;
  
    vaxis = axis;

end

set(gca,'Fontsize',16)
if nargin == 5;
leghandle = legend('Benchmark','Bivariate','Location','Northwest');
set(leghandle,'fontsize',textsize);
end;



title('$\phi_{\tau}$','fontsize',textsize,'Interpreter','latex')
   
%orient landscape
%print -dpdf newfigures/estmodel_mu_phi_2016

subplot(2,3,2)
zx = 3;
  plot(xdates,estbeta(:,zx))
  if nargin ==  5;
     plot(xdates,altbeta(:,zx),'b-','linewidth',2)
end;

lwbnd = [xdates estbeta(:,zx)-2*stderrs(:,zx)  ];
upbnd = [xdates estbeta(:,zx)+2*stderrs(:,zx)];
cipatch = [lwbnd;upbnd(end:-1:1,:)];
patch(cipatch(:,1),cipatch(:,2),cigrey)
hold on
plot(xdates,estbeta(:,zx),'linewidth',2.75,'color',[7,60,101]/255)
 if nargin ==  5;
     plot(xdates,altbeta(:,zx),'b-','linewidth',2)
end;
axis tight;
vaxis = axis;
axis([xdates(1)  xdates(end)+365 vaxis(3:4)])  
set(gca,'xtick',datenum(yearticks,6,30), 'Layer', 'top')
datetick('x','keeplimits','keepticks')

if zx > 2;
  
    vaxis = axis;
    axis([vaxis(1:2) 0 0.2]);

end

set(gca,'Fontsize',textsize)
title('$\sigma_p$','fontsize',textsize,'Interpreter','latex')

subplot(2,3,3)
zx = 4;
  plot(xdates,estbeta(:,zx))
  if nargin == 5;
     plot(xdates,altbeta(:,zx),'b-','linewidth',2)
end;
lwbnd = [xdates estbeta(:,zx)-2*stderrs(:,zx)  ];
upbnd = [xdates estbeta(:,zx)+2*stderrs(:,zx)];
cipatch = [lwbnd;upbnd(end:-1:1,:)];
patch(cipatch(:,1),cipatch(:,2),cigrey)
hold on
plot(xdates,estbeta(:,zx),'g-','linewidth',2.75,'color',[7,60,101]/255)
if nargin == 5;
     plot(xdates,altbeta(:,zx),'b-','linewidth',2)
end;
axis tight;
vaxis =   axis;
axis([xdates(1)  xdates(end)+365 vaxis(3:4)])  

set(gca,'xtick',datenum(yearticks,6,30), 'Layer', 'top')
datetick('x','keeplimits','keepticks')

if zx > 2;
  
    vaxis = axis;
       axis([vaxis(1:2) 0 0.2]);

end
set(gca,'Fontsize',16)
title('$\sigma_{\tau}$','fontsize',textsize,'Interpreter','latex')

orient landscape
%print -dpdf -bestfit newfigures/estmodel_rhosigmas_July2017



end

